AlaskaLinuxUser's Scratchpad

Commit thy works unto the LORD, and thy thoughts shall be established. - Proverbs 16:3

CitySim Zone Mechanics

20260419.png

While I have very few programming skills, one of the hardest parts of working on this game is not the actual work of programming, but of figuring out the numbers needed for the game mechanics, in order to have a smooth and fun game. Granted, I am struggling a bit with the syntax of the javascript portions of the programming, once I have a general idea of what I want to do, it seems fairly straight forward to implement. So far, it has mostly been if/else statements.

For instance, I already know that I want to keep things very simple. In general, growth is based on population, and population is based on the number of residential zones that are populated, and then based on the level of those residential zones. But I need some game mechanics to keep the player from just building 1000 residential zones that will automatically progress through the levels and max out their population. Otherwise, it would not be a 'game'. So, I have to add something to keep that from happening.

Thus, I'm building in a bunch of dependencies. For instance, I implemented pollution. If pollution is too high, then the residential zones will not level up. The player can physically build all of the residential zones they want, but when they do, those zones can't progress past level 1, which only adds a max population count of 75. Even if they built a thousand of them, as long as pollution is too high, they only gain 7,500 people, and their income would be severely capped. This forces the player to consider building parks and other pollution reducing buildings/tiles.

Implementing pollution was relatively easy, even with my limited programming knowledge. The harder part has been playing the game over and over again to figure out what pollution limits are appropriate.

Likewise, I hope to implement several other things to cap residential zones from leveling up, such as a crime rate, health, and entertainment. In other words, who would move to a city that has a high crime rate, or that had no entertaining things to do there. By setting these caps for leveling up, my hope is that it will affect all stages of the game equally, as each level up will have to check these stats, and as the residential zones level up, and the population increases, it will require more support buildings, such as hospitals, entertainment venues, and police stations to keep up.

Commercial and industrial zones are a little bit simpler, but will follow a similar path. Currently, their level is capped by the amount of populated residential areas, but I plan to add education as a factor as well. E.g., right now, an industrial zone can't level up unless there is a suitable amount of residential zones (population) to support it. But in future work, I hope to also add education as a cap, meaning that you need higher education, for more skilled labor, to support higher levels of these zones, which will ultimately gain the player more money.

One thing I am debating currently is the ability for other buildings, like police stations, to 'level up' or not. If they did level up, would it be enough to keep up with the leveling up of the population? I'm not sure. I want to keep from having to build six police stations in one neighborhood to keep crime down if there are sky-rise residential areas. At the same time, if police stations do level up, I don't want the player to get board because they built one and are now done having to build them ever again.

Other dependencies, such as power and fire departments will work in a different way. Rather than capping the ability to level up, they will impede the user in other ways, but that is the subject of a different post. Don't forget that you can check out the latest commits on Gitlab. [1]

Linux - keep it simple.

[1] https://gitlab.com/alaskalinuxuser/citysim-ubuntutouch